package com.zx.BookSeaReader.ui.chaptercomment;

import android.widget.TextView;

import com.zx.BookSeaReader.R;
import com.zx.BookSeaReader.greendao.entity.BookChapterComment;
import com.zx.BookSeaReader.greendao.entity.BookLabelBean;
import com.zx.BookSeaReader.ui.base.adapter.ViewHolderImpl;
import com.zx.BookSeaReader.util.Constant;
import com.zx.BookSeaReader.util.StringUtils;


public class BookChapterCommentHolder extends ViewHolderImpl<BookChapterComment> {
    private TextView mTvFloor;
    private TextView mTvAuthorName;
    private TextView mTvCommentTime;
    private TextView mTvContent;
    private TextView mTvLikeCount;

    @Override
    public void initView() {
        mTvFloor = findById(R.id.comment_tv_floor);
        mTvAuthorName = findById(R.id.comment_tv_name);
        mTvCommentTime = findById(R.id.comment_tv_time);
        mTvContent = findById(R.id.comment_tv_content);
        mTvLikeCount = findById(R.id.comment_tv_like_count);
    }

    @Override
    public void onBind(BookChapterComment data, int pos) {

        mTvFloor.setText(data.getFloorCount()+"楼");
        mTvAuthorName.setText(data.getUsername());
        mTvCommentTime.setText(StringUtils.dateConvert(data.getCreateTime(), Constant.FORMAT_BOOK_DATE));
        mTvContent.setText(data.getContent());
        mTvLikeCount.setText(data.getLikeCount()+"");


    }

    @Override
    protected int getItemLayoutId() {
        return R.layout.item_comment;
    }
}
